package com.mindai.esper.monitor.inputadapters.service;

import com.alibaba.fastjson.JSON;
import com.mindai.esper.monitor.biz.epl.EsperEplService;
import com.mindai.esper.monitor.inputadapters.model.EsperRequestAdapter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by Administrator on 2017/8/15.
 */
@Service
public class ComplexEventProcessingService {

    @Autowired
    EsperEplService esperEplService;

    public void dealEsperInputData(EsperRequestAdapter esperRequest) {
       //将数据转换成Map格式
    Map mapTypes = JSON.parseObject(esperRequest.getJsonMessage());
    esperEplService.getRuntime().sendEvent(mapTypes, "EsperRequest");
}

}
